<?php
/**
 * 
 * 邮件发送接口,定义邮件发送接口,统一邮件发送操作
 * 
 * @author Leo Ning 2010-12-06 20:40
 * @version 1.0
 * @since 1.0
 */
interface IMailSender {
	/**
	 * Adds a "Cc" address.
	 * 
	 * @param string $address
	 * @param string $name
	 * @return boolean true on success, false if address already used
	 */
	function AddCC($address, $name = '');
	/**
	 * Adds a "Reply-to" address.
	 * @param string $address
	 * @param string $name
	 * @return boolean
	 */
	function AddReplyTo($address, $name = '');
	/**
	 * Adds an attachment from a path on the filesystem.
	 * Returns false if the file could not be found
	 * or accessed.
	 * @param string $path Path to the attachment.
	 * @param string $name Overrides the attachment name.
	 * @param string $encoding File encoding (see $Encoding).
	 * @param string $type File extension (MIME) type.
	 * @return bool
	 */
	function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream');
	/**
	 * 
	 * 发送HTML格式的内容
	 * @param string $subject 主题
	 * @param array $to key=>value方式的收件人key代表
	 * @param string $html 要发送的内容
	 * @param string $altBody 
	 * @return boolean
	 */
	function sendHtml($subject, $to, $html, $altBody = '');
	/**
	 * 
	 * 发送TEXT格式的内容
	 * @param string $subject 主题
	 * @param array $to key=>value方式的收件人key代表
	 * @param string $text 要发送的内容
	 * @param string $altBody 
	 * @return boolean
	 */
	function sendText($subject, $to, $text, $altBody = '');
}